package com.gko100.dao.impl;

import java.util.List;

import com.gko100.dao.PermissionDao;
import com.gko100.dao.basehibernatesupport.BaseHibernateDaoSupport;
import com.gko100.model.Permission;


public class PermissionDaoHibernate extends BaseHibernateDaoSupport implements PermissionDao {

	public List<Permission> findPermList(){
		
		List<Permission> permList=this.getHibernateTemplate().find("from Permission");
		if(permList!=null&&permList.size()>=1){
			
			return permList;
		}else{
			
			return null;
		}
	}


	public void add_perm(Permission perm) {
		
		this.getHibernateTemplate().save(perm);
		
	}

	/* 
	 * {见接口方法说明}
	 */
	public void del_perm(Permission perm) {
		
		this.getHibernateTemplate().delete(perm);
		
	}

	/* 
	 * {见接口方法说明}
	 */
	public void modify_perm(Permission perm) {
		
		this.getHibernateTemplate().update(perm);
		
	}

	/* 
	 * {见接口方法说明}
	 */
	public Permission findPermByPermId(Integer permId) {
		
		Permission perm = this.getHibernateTemplate().get(Permission.class, permId);
		if(perm!=null){
			return perm;
		}else{
			
			return null;
		}
	}

}
